# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2SimpleAddressType do
  @moduledoc """
  A simple representation of an address.

  ## Attributes

  *   `city` (*type:* `String.t`, *default:* `nil`) - The city or town for the address.
  *   `line1` (*type:* `String.t`, *default:* `nil`) - The street name and number of this address.
  *   `line2` (*type:* `String.t`, *default:* `nil`) - The second line the address, if needed.
  *   `line3` (*type:* `String.t`, *default:* `nil`) - The third line of the address, if needed.
  *   `locationName` (*type:* `String.t`, *default:* `nil`) - The name of the location.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The US two letter state abbreviation of the address.
  *   `zip` (*type:* `String.t`, *default:* `nil`) - The US Postal Zip Code of the address.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :city => String.t() | nil,
          :line1 => String.t() | nil,
          :line2 => String.t() | nil,
          :line3 => String.t() | nil,
          :locationName => String.t() | nil,
          :state => String.t() | nil,
          :zip => String.t() | nil
        }

  field(:city)
  field(:line1)
  field(:line2)
  field(:line3)
  field(:locationName)
  field(:state)
  field(:zip)
end

defimpl Poison.Decoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2SimpleAddressType do
  def decode(value, options) do
    GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2SimpleAddressType.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2SimpleAddressType do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
